package com.agricultural.machine.decorator;

import com.agricultural.machine.common.IMachine;
import com.agricultural.machine.common.MachineState;

/**
 * 农机装饰器抽象类 - 装饰器模式
 */
public abstract class MachineDecorator implements IMachine {
    protected IMachine decoratedMachine;
    
    public MachineDecorator(IMachine decoratedMachine) {
        this.decoratedMachine = decoratedMachine;
    }
    
    @Override
    public String getMachineId() {
        return decoratedMachine.getMachineId();
    }
    
    @Override
    public String getType() {
        return decoratedMachine.getType();
    }
    
    @Override
    public MachineState getState() {
        return decoratedMachine.getState();
    }
    
    @Override
    public void setState(MachineState state) {
        decoratedMachine.setState(state);
    }
    
    @Override
    public void start() {
        decoratedMachine.start();
    }
    
    @Override
    public void stop() {
        decoratedMachine.stop();
    }
    
    @Override
    public void executeTask(String task) {
        decoratedMachine.executeTask(task);
    }
    
    @Override
    public void updatePosition(double x, double y) {
        decoratedMachine.updatePosition(x, y);
    }
    
    @Override
    public String getPosition() {
        return decoratedMachine.getPosition();
    }
    
    @Override
    public double getCurrentX() {
        return decoratedMachine.getCurrentX();
    }
    
    @Override
    public double getCurrentY() {
        return decoratedMachine.getCurrentY();
    }
    
    @Override
    public void work() {
        decoratedMachine.work();
    }
    
    @Override
    public boolean isRunning() {
        return decoratedMachine.isRunning();
    }
    
    @Override
    public void setEmergencyStop(boolean emergency) {
        decoratedMachine.setEmergencyStop(emergency);
    }
    
    @Override
    public boolean isEmergencyStopped() {
        return decoratedMachine.isEmergencyStopped();
    }
}















